#pragma once

#include <hiredis/hiredis.h>
#include <memory>
#include <string>

class HiredisClient
{
public:
    HiredisClient(const std::string &ip, uint16_t port);
    ~HiredisClient();

public:
    bool                        connect();
    bool                        execute(const char *command, ...);
    std::shared_ptr<redisReply> getReply();

private:
    std::string   m_ipaddr;
    uint16_t      m_port;
    redisContext *m_context;
    bool          m_connected;
};